<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    
<%@ page import="com.scott.user.form.User" %>
<%@ page import="com.scott.user.dao.UserDao" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
	</head>
<body>

	<font color="red">用户修改页面</font>
	<br/><br/>
	
	<%
		String id = request.getParameter("id");
		UserDao dao = new UserDao();
		User user  = dao.getUserById(Integer.parseInt(id));
		
		System.out.print(user);
	
	%>
		
		
	<!-- 注意2点：  2.1 在updateUser前面不要打斜杠  2.2在updateUser后面需要增加后缀.do -->
	<form action="updateUser.do" method="post">
	
		<input type="hidden" name="id" value="<%=user.getId()%>">
		<table>
			<tr>
				<td>用户名：</td>
				<td>
					<input type="text" readonly name="username" value="<%=user.getUsername()%>">
				</td>
			</tr>
			
			<tr>
				<td>密&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
				<td>
					<input type="password" name="password" value="<%=user.getPassword()%>">
				</td>
			</tr>
			
			<tr>
				<td colspan="2">
					<input type="submit" value="修改" />
				</td>
			</tr>
		</table>
	
	</form>
	
	
	<!-- 用来显示错误提示 -->
	<div id="msg"></div>
	
	
	<br/><br/>
	<a href="main.jsp">返回主页面</a><br/>


</body>
</html>